//******************************************************** // Horizontal Sundial // NASS Sundial Design Tutorials // Part 2 Sundial Base and Hour Lines // Robert L. Kellogg, Ph.D. // 1 Jan 2020 // // This design is part of the creative commons //******************************************************** /* Tutorial #1 We're going to create the base of a sundial. Three variation are given: a circular sundial and a dial base with 6 or 8 sides (hexagon or octagon). We'll make the sundial base with a slight taper of the sides. This is just a bit of simple esthetics. A goal of making this sundial is to create module procedures such that we can see each step and if we want, experiment with changes to the dial features Tutorial #2 Then we add hour lines. The base of the hour lines is moved off-center to the south by a distance Loffset. We've left enough room around the hour lines that we can add hour numbers in the next tutorial */ echo("Part-2 Drawing the Hour Angles"); //NASS Tutorial // ---------------------------------------------------- // --------------- Sundial Parameters ---------------- // ---------------------------------------------------- // Note: base units are in mm and angles in degrees shape = "octagon"; // "circular" dial base // "hexagon" dial base // "octagon" dial base dial_btm = 78; //dial base diam (~3") mm dial_top = 75; //dial base (taper top) mm dial_hght = 3; //dial base height mm lat = 40; //dial latitude deg minHA = 5; //first hour line am hour maxHA = 7; //last hour line pm hour Lwidth = 1; //hour line width mm Lhght = 1; //hour line height mm Llength = dial_top; //hour line length mm Loffset = dial_top/4; //hour line & gnomon offset Dout = .68*dial_top; //outer distance of chapter ring Din = .58*dial_top; //inner distance of chapter ring // ---------------------------------------------------- // ------------ Main Program Starts Here ------------- // ---------------------------------------------------- if(shape=="circular") { echo("shape",shape); minangle = 3; sundial_base(minangle,turn=0); } if(shape=="octagon") { echo("shape",shape); minangle = 45; sundial_base(minangle,turn=45/2); } if(shape=="hexagon") { echo("shape",shape); minangle = 60; sundial_base(minangle,turn=0); } //add hour lines to the top of the sundial hour_lines(minHA,maxHA,lat); // ---------------------------------------------------- // ----------- Procedure Modules Start Here ----------- // ---------------------------------------------------- module hour_lines(minHA,maxHA,lat){ // first and last hour angle in degrees first = 15*(minHA - 12); last = 15*(maxHA); // loop through the hours for(HA=[first:15:last]){ //theta is the hour line angle theta = atan2(sin(lat)*sin(HA),cos(HA)); translate([0,0,dial_hght]){ intersection(){ //mask the raw hour angle donut_mask(Din,Dout,Lhght); translate([0,-Loffset,0]) // raw hour angle rotate([0,0,theta]) translate([0,Llength/2,Lhght/2]) cube([Lwidth,Llength,Lhght],center=true); } } } } module donut_mask(Din, Dout, Dhght){ //set the cylinder with 180 faces (2 deg segments $fn = 180; //subtract inner cylinder from the outer cylinder difference(){ cylinder(d=Dout,h=Dhght); cylinder(d=Din,h=3*Dhght,center=true); } } module sundial_base(mini,turn){ //create a multi-edge sundial $fa = mini; rotate([0,0,turn]) cylinder($fa,h=dial_hght,d1=dial_btm,d2=dial_top); }